/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package percobaan_1;

/**
 *
 * @author Liem
 */
public class Main {
    public static void main(String args[]){
        ShoppingCart <Barang> sc = new ShoppingCart("Doni");
        sc.addItem(new Barang("permen",3));
        sc.addItem(new Barang("cokelat",46));
        sc.addItem(new Barang("McFlurry",3));
        sc.addItem(new Barang("French Fries",46));
        sc.addItem(new Barang("Takoyaki",3));
        sc.addItem(new Barang("Okonomiyaki",46));
        sc.addItem(new Barang("Sari roti coklat",3));
        sc.addItem(new Barang("Sari roti keju",46));
        sc.addItem(new Barang("Biting",3));
        sc.addItem(new Barang("Mi ayam",46));
        
        System.out.println("nama: " + sc.getNama());
        System.out.println("Pesanan anda ");
   
/*        for(Barang b: sc.getGoodies())
        {
            System.out.println("b: " + b);
            System.out.println("nama barang : " + b.getNama_barang());
            System.out.println("Jumlah : " + b.getJumlah());
        }
 */     

        
        
        for(int i = 3; i<8 ; i++){
            Barang b = sc.getItem(i);
            System.out.println("nama barang : " + b.getNama_barang());
            System.out.println("Jumlah : " + b.getJumlah());
        }
        
        for(int i = 3; i<8 ; i++){
            System.out.println("nama barang : " + sc.getItem(i).getNama_barang());
            System.out.println("Jumlah : " + sc.getItem(i).getJumlah());
        }
        
    }
}
